package com.example.common.security.expression;

import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
import org.springframework.stereotype.Component;

/**
 * @program: springsecurity-study
 * @description:
 * @author: ChenZhiXiang
 * @create: 2019-08-01 17:31
 **/
@Component
@Order(Integer.MAX_VALUE)
public class MyAuthorizeConfigProviderLast implements AuthorizeConfigProvider {

    @Override
    public void config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry config) {
        config.anyRequest().access("@rbacServiceImpl.hasPermission(request,authentication)");
    }
}
